<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>服务创建</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
</head>
<body style="margin: 15px">

<div id="p" class="easyui-panel" title="服务创建" style="width: 600px;height: 350px;padding: 10px">
    <form id="fm" method="post">
        <table cellspacing="8px">
            <tr>
                <td>服务类型：</td>
                <td><input class="easyui-combobox" required="true" id="serveType" name="serveType" data-options="panelHeight:'auto',editable:false,valueField:'dataDicValue',textField:'dataDicValue',url:'${pageContext.request.contextPath}/dataDic/dataDicValueComboList.do?dataDicName=服务类型'"/>&nbsp;<font color="red">*</font></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>客户</td>
                <td><input class="easyui-combobox" required="true" id="customer.id" name="customer.id" data-options="panelWidth:160,panelHeight:'auto',editable:false,valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/customer/comboList.do'"/>&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>概要：</td>
                <td colspan="4"><input class="easyui-textbox" id="overview" name="overview" style="width: 419px;height: 56px" multiline="true" required="true"/>&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>服务请求：</td>
                <td colspan="4"><input class="easyui-textbox" id="serviceRequest" name="serviceRequest" style="width: 419px;height: 56px" multiline="true" required="true">&nbsp;<font color="red">*</font></td>
            </tr>
            <tr>
                <td>创建人：</td>
                <td><input class="easyui-textbox" editable="false" id="createPeople" name="createPeople" value="${currentUser.trueName }"/>
                </td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td>创建时间：</td>
                <td><input class="easyui-textbox" id="createTime" name="createTime" editable="false"/></td>
            </tr>
            <tr>
                <td colspan="4"></td>
                <td>
                    <a href="javascript:saveCustomerService()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>&nbsp;&nbsp;
                    <a href="javascript:resetValue()" class="easyui-linkbutton" iconCls="icon-reset">重置</a>
                </td>
            </tr>
        </table>
        <input type="hidden" name="state" value="新创建"/>
    </form>
</div>


</body>
</html>

<script type="text/javascript">


    $(function () {

        $("#createTime").textbox("setValue", getCurrentDate());

    });

    function resetValue() {
        $("#fm").form("reset");
        $("#createTime").textbox("setValue", getCurrentDate());
    }

    function saveCustomerService() {
        var url = "${pageContext.request.contextPath}/customerService/save.do";
        $("#fm").form("submit", {
            url: url,
            onSubmit: function () {
                return $(this).form("validate");
            },
            success: function (result) {
                var result = eval('(' + result + ')');
                if (result.success) {
                    $.messager.alert("系统提示", "保存成功！");
                    resetValue();
                } else {
                    $.messager.alert("系统提示", "保存失败！");
                    return;
                }
            }
        });
    }

</script>